package com.iotechn.unimall.app.api.userShop;

import com.iotechn.unimall.core.Const;
import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.UserShopDO;
import com.iotechn.unimall.data.model.Page;

/**
 * @author hct
 * @email 77802226@qq.com
 * @date 2022-05-24 21:04:46
 */
@HttpOpenApi(group = "userShop", description = "")
public interface UserShopService {

    @HttpMethod(description = "创建")
    public UserShopDO create(
            @NotNull @HttpParam(name = "userShopDO", type = HttpParamType.COMMON, description = "") UserShopDO userShopDO,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "管理员ID") Long userId,
            @HttpParam(name = Const.SPU_USER_ACCESS_TOKEN, type = HttpParamType.HEADER, description = "访问令牌") String accessToken

    ) throws ServiceException;

    @HttpMethod(description = "修改")
    public UserShopDO update(
            @HttpParam(name = Const.USER_ACCESS_TOKEN, type = HttpParamType.HEADER, description = "访问令牌") String accessToken,
            @NotNull @HttpParam(name = "userShopDO", type = HttpParamType.COMMON, description = "") UserShopDO userShopDO,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "管理员ID") Long userId) throws ServiceException;

    @HttpMethod(description = "删除")
    public String delete(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "管理员ID") Long userId) throws ServiceException;

    @HttpMethod(description = "详情")
    public UserShopDO detailByUserId(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "管理员ID") Long userId) throws ServiceException;

    @HttpMethod(description = "详情")
    public UserShopDO detailById(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") Long id
    ) throws ServiceException;

    @HttpMethod(description = "列表")
    public Page<UserShopDO> list(
            @HttpParam(name = "shopName", type = HttpParamType.COMMON) String shopName,
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit
    ) throws ServiceException;

}

